package com.zuihai.app.mvp.ui.holder;

import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.blankj.utilcode.util.LogUtils;
import com.zuihai.app.R;
import com.zuihai.app.mvp.model.entity.HomeItem;

import java.util.List;

import butterknife.BindView;

/**
 * Created by Administrator on 2017/5/4 0004.
 */

public class HomeRecyclerOneHolder extends BaseViewHolderWraper<HomeItem> {

    @BindView(R.id.tv_title)
    TextView mTitle;

    @BindView(R.id.iv_cover_one)
    ImageView mCoverOne;

    @BindView(R.id.iv_cover_two)
    ImageView mCoverTwo;

    @BindView(R.id.iv_cover_three)
    ImageView mCoverThree;

    @BindView(R.id.tv_name)
    TextView mName;

    @BindView(R.id.tv_comment)
    TextView mComment;

    @BindView(R.id.tv_favour)
    TextView mFavour;

    public HomeRecyclerOneHolder(View itemView) {
        super(itemView);
    }

    public void fillData(HomeItem data, int position) {
        LogUtils.e(data.title +"************************");
        setText(R.id.tv_title, data.title);
        final List<HomeItem.Picture> pictures = data.picture;
        loadImage(R.id.iv_cover_one, pictures.get(0).url);
        loadImage(R.id.iv_cover_two, pictures.get(1).url);
        loadImage(R.id.iv_cover_three, pictures.get(2).url);
        //设置来源
        setTextFormat(R.id.tv_name, data.name);
        //设置评论数量
        setTextFormat(R.id.tv_comment, data.commentCount);
        //设置点赞数量
        setTextFormat(R.id.tv_favour, data.favour+"");

    }
}
